<!DOCTYPE html>
<html lang="en">
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="/js/jquery.min.js"></script>
    <script src="/ajax/libs/layui/layui.all.js"></script>
    <link rel="stylesheet" type="text/css" href="/ajax/libs/layui/css/layui.css"/>
</head>
<style>
    /*a {*/
        /*width: 100%;*/
        /*height: 100%;*/
        /*display: inline-block;*/
    /*}*/
    /*img {*/
        /*width: 100%;*/
        /*height: 100%;*/
    /*}*/
</style>
<body>
xxxxxxx
<input id="lalal" type="text">
<input id="heihiehi" type="text">
<input type="button" value="提交xxxx" onclick="xxx()">

<div class="layui-carousel" id="test1" lay-filter="test1">
    <div carousel-item="" id="hero">
        <div><a style="background-image:url(../../img/banner.png);display: block;
    background-repeat: no-repeat;
    background-position: center center;
     -webkit-background-size: cover;
    background-size: cover;
    height: 100%;"></a></div>

        <div>xxx</div>
        <div>xxxxxx</div>
</div>
</div>
</body>
<script type="text/javascript">


    $.ajax({
        url : "http://192.168.1.195:4040/system/banner/home2",
        type : "get",
        success : function(result) {
            for( o in result.data){
                console.log(result.data[o])
                var str = "<div>"
                str+="<a style=\"background-image:url(../../"+result.data[o]+");display: block;\n" +
                    "    background-repeat: no-repeat;\n" +
                    "    background-position: center center;\n" +
                    "    -webkit-background-size: cover;\n" +
                    "    background-size: cover;\n" +
                    "    height: 100%;\"></a>"
                str+="</div>"
                $("#hero").append(str)
            }

            layui.use(['carousel'],function () {
                console.log("???")
                var carousel = layui.carousel;
                //常规轮播
                carousel.render({
                    elem: "#test1",//绑定ID
                    arrow: 'none',//hover 悬停显示 always 始终显示 none 始终不显示
                    width: "100%",
                    height:"550px"
                })
            });
        },
        error:function () {
            layer.msg('失败',{'icon':2});
        }
    });
function xxx() {

    var data ={};
    data.result = $("#lalal").val()
    data.refuse = $("#heihiehi").val()

    $.ajax({
        url : "/system/refuse",
        type : "post",
        data : data,
        success : function(result) {
            console.log("xxxxxxx")
            layer.close(index)
        },
        error:function () {
            layer.msg('失败',{'icon':2});
        }
    });
}

</script>
</html>